package com.xianyun.site.iblog.user.executor.query;

import com.xianyun.site.iblog.dto.user.SystemUserLoginQry;
import com.xianyun.site.iblog.dto.user.data.SystemUserDTO;
import com.xianyun.site.iblog.user.executor.handle.LoginCheckContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.validation.Valid;

/**
 * 除三方登录之外的用户登录（拿用户数据）
 * @author mac_zyj
 */
@Component
public class SystemUserLoginQryExo {

    @Autowired
    private LoginCheckContext loginCheckContext;

    public SystemUserDTO execute(@Valid SystemUserLoginQry qry){
        loginCheckContext.setCurrentHandle(qry.getExtendType());
        return loginCheckContext.loginUser(qry);
    }
}
